<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\SwiperBean;

class SwiperValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 SwiperBean::$id => 'require', //
			 SwiperBean::$storeId => 'require', //商家id
			 SwiperBean::$imgUrl => 'require|max:255', //轮播图图片地址
			 SwiperBean::$href => 'require|max:255', //点击跳转路径
			 SwiperBean::$isShow => 'require', //是否展示，1展示，2不展示
			 SwiperBean::$displayOrder => 'require', //排序字段
			 SwiperBean::$createdAt => 'require', //创建时间
			 SwiperBean::$updatedAt => 'require', //更新时间
		];
		$this->message = [
			SwiperBean::$id.POINST."require " => 'id必须', //
			SwiperBean::$storeId.POINST."require " => 'store_id必须', //商家id
			SwiperBean::$imgUrl.POINST."require " => 'img_url必须', //轮播图图片地址
			SwiperBean::$href.POINST."require " => 'href必须', //点击跳转路径
			SwiperBean::$isShow.POINST."require " => 'is_show必须', //是否展示，1展示，2不展示
			SwiperBean::$displayOrder.POINST."require " => 'display_order必须', //排序字段
			SwiperBean::$createdAt.POINST."require " => 'created_at必须', //创建时间
			SwiperBean::$updatedAt.POINST."require " => 'updated_at必须', //更新时间
		];
		$this->scene = [
			self::$all => [SwiperBean::$id,SwiperBean::$imgUrl,SwiperBean::$href,SwiperBean::$isShow,SwiperBean::$displayOrder,SwiperBean::$createdAt,SwiperBean::$updatedAt,],
            self::$add => [SwiperBean::$imgUrl],
            self::$edit => [SwiperBean::$id,SwiperBean::$imgUrl],
            self::$pkId => [SwiperBean::$id]
		];
	}


}
